package com.lookme.lmtool.cracker.filter.pixellate;

import com.jhlabs.image.BlockFilter;
import com.jhlabs.image.CrystallizeFilter;
import com.lookme.lmtool.cracker.CrackerConstants;
import com.lookme.lmtool.cracker.annotation.FilterAnnotation;
import com.lookme.lmtool.cracker.annotation.ParamAnnotation;
import com.lookme.lmtool.cracker.filter.AbstractFilter;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import java.awt.image.BufferedImageOp;

@FilterAnnotation(groupName = CrackerConstants.FILTER_GROUP_NAME_PIXELLATE,name="马赛克",filterClass = BlockFilter.class)
public class FilterBlock extends AbstractFilter {
    @XStreamAsAttribute
    @ParamAnnotation(name = "半径", desc = "像素点半径",inputType = ParamAnnotation.InputType.Slider,width = 300,amountToStepBy = 1,min=1,max=100,blockIncrement = 5,majorTickUnit=10,minorTickCount = 2)
    int blockSize=2;

    @Override
    public BufferedImageOp getFilter() {
        BlockFilter filter= new BlockFilter();
        filter.setBlockSize(blockSize);
        return filter;
    }
}
